New-MailboxExportRequest  Format/name off exported .pst file

Environment: Exchange 2013

Hi everyone,

im preparing a bulk mailboxexport. Everything is working fine, but currently running the export will generate the following filename: @{Alias=BryaTest}.pst  

And im trying to find a way to generate DisplayName.pst  or Alias.pst or something like that. So, that exporting a mailbox with Alias BryaTest will create Bryan Test.pst, or BryaTest.pst

This is the ps1 im running: (generated with information from another topic here)

$mailboxes=import-csv c:\temp\bulkmailexport.csv

foreach($mailbox in $mailboxes)
{

New-MailboxExportRequest -Mailbox $mailbox.alias -FilePath "\\VM-Server01\c$\temp\$Mailbox.pst"

}

And the contents of the .csv file:

Alias
BryaTest

Any help would be great!

March 12th, 2015 6:54am

Hi 

you are getting the display "@{Alias=BryaTest}.pst  " because $mailbox is an object not a simple string.

You need to select the attribute that you want to use , for example:

foreach($mailbox in $mailboxes)
{
$Alias=$mailbox.alias
New-MailboxExportRequest -Mailbox $mailbox.alias -FilePath "\\VM-Server01\c$\temp\$Alias.pst"

}

  • Proposed as answer by Amine.G 18 hours 45 minutes ago
  • Marked as answer by Bryan132 18 hours 36 minutes ago
Free Windows Admin Tool Kit Click here and download it now
March 12th, 2015 8:36am

Hi, that's it..it's working now.  Thank you!
March 12th, 2015 8:48am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics